package com.xiaoq.sites.service.impl;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.xiaoq.sites.entity.InfrastructureBaseEntity;
import com.xiaoq.sites.repository.IInfrastructureRepository;
import com.xiaoq.sites.service.IInfrastructureService;


//@Service(interfaceClass=IInfrastructureApi.class, version="1.0.0")
@Component
public class InfrasturctureServiceImpl implements IInfrastructureService{
	
	@Autowired
	private IInfrastructureRepository infraPro;

	

	


	@Override
	public List<InfrastructureBaseEntity> findSitesInfraType(String sitesId, Integer infraType) {
		List<InfrastructureBaseEntity> infraList = null;
		if(StringUtils.isNotBlank(sitesId)&&infraType!=null){
			infraList=infraPro.findInfraBySitesIdAndInfraType(sitesId, infraType);
		}
		return infraList;
	}






	@Override
	public boolean addSitesInfraType(InfrastructureBaseEntity infrastructureBase) {
		
		return infraPro.addSitesInfraType(infrastructureBase);
	}






	@Override
	public boolean deleteSitesInfraType(String infrastructId) {
		
		return infraPro.deleteSitesInfraType(infrastructId);
	}






	@Override
	public InfrastructureBaseEntity findInfraById(String id) {
		return infraPro.findInfraById(id);
	}


	





	

}
